package com.hw.service.sys;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hw.entity.po.sys.SysPermission;
import com.hw.mapper.sys.SysPermissionMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 权限 Service实现类
 *
 * @author whw
 * @date 2021-06-21
 */
@Service
public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, SysPermission> implements SysPermissionService {
    @Override
    public List<SysPermission> list(List<String> roleIds) {
        QueryWrapper<SysPermission> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("permission.c_deleted", 0)
                .in("relate.c_role_id", roleIds);
        return baseMapper.list(queryWrapper);
    }
}
